function Database_PlayerJoined(ply)
	sql.Query("CREATE TABLE IF NOT EXISTS player_data (id INT(10) AUTO_INCREMENT, steamid VARCHAR(20) NOT NULL, money INT(100) DEFAULT '250', PRIMARY KEY (id)) TYPE=MyISAM;")
	
	local PlayerRecord = sql.Query("SELECT id FROM player_data WHERE steamid = '" .. ply:SteamID() .. "' LIMIT 1")
	if PlayerRecord and table.Count(PlayerRecord) == 1 then
		ply:SetNWInt("money", PlayerRecord[0]["money"])
		print(PlayerRecord[0]["money"])
	else
		sql.Query("INSERT INTO player_data (steamid) VALUES ('" .. ply:SteamID() .. "')")
		ply:SetNWInt("money", 250)
	end
end
